create or replace view vac_lov_templates_4_1 as
with lt as
(
  select
  workspace,
  workspace_display_name,
  application_id,
  application_name,
  popup_icon,
  popup_icon_attr,
  popup_icon2,
  popup_icon_attr2,
  page_title,
  page_html_head,
  page_body_attr,
  before_field_text,
  after_field_text,
  page_heading_text,
  page_footer_text,
  before_result_set,
  after_result_set,
  filter_width,
  filter_max_width,
  filter_text_attr,
  find_button_text,
  find_button_image,
  find_button_attr,
  close_button_text,
  close_button_image,
  close_button_attr,
  next_button_text,
  next_button_image,
  next_button_attr,
  prev_button_text,
  prev_button_image,
  prev_button_attr,
  scrollbars,
  resizable,
  width,
  height,
  result_row_x_of_y,
  to_char(result_rows_per_pg) result_rows_per_pg,
  when_no_data_found_message,
  before_first_fetch_message,
  to_char(minimum_characters_required) minimum_characters_required,
  theme_number,
  theme_class,
  is_subscribed,
  subscribed_from,
  last_updated_on,
  last_updated_by,
  translatable,
  component_comment,
  template_id,
  component_signature
 from apex_application_temp_popuplov
)
select
  workspace,
  workspace_display_name,
  application_id,
  application_name,
  theme_class,
  theme_number,
  last_updated_on,
  last_updated_by,
  template_id,
  'APEX_APPLICATION_TEMP_POPUPLOV' src_view_name,
  u_name,
  u_value
from lt
 UNPIVOT INCLUDE NULLS
  (u_value FOR u_name IN
     (
        popup_icon,
        popup_icon_attr,
        popup_icon2,
        popup_icon_attr2,
        page_title,
        page_html_head,
        page_body_attr,
        before_field_text,
        after_field_text,
        page_heading_text,
        page_footer_text,
        before_result_set,
        after_result_set,
        filter_width,
        filter_max_width,
        filter_text_attr,
        find_button_text,
        find_button_image,
        find_button_attr,
        close_button_text,
        close_button_image,
        close_button_attr,
        next_button_text,
        next_button_image,
        next_button_attr,
        prev_button_text,
        prev_button_image,
        prev_button_attr,
        scrollbars,
        resizable,
        width,
        height,
        result_row_x_of_y,
        result_rows_per_pg,
        when_no_data_found_message,
        before_first_fetch_message,
        minimum_characters_required,
        is_subscribed,
        subscribed_from,
        translatable,
        component_comment
     )
  );

